<?php
App::import('module','admin/admincontroller');
Class ConfigController extends AdminController
{    
	public $uses = array('Config');	
	
	public function index()
    {      	    	
		$config = $this->Config->findForId(1);
		$this->set('config',$config);
    }
    
    public function edit()
    {     	
    	if(!empty($this->data))
    	{   
    		$id = $this->Config->Save($this->data);
    		$this->setShow('Configuração salvo com sucesso!');
    		$this->_context->redirectUrl('admin.config');
    	}
    	if (empty($this->data)) {   		
			$this->createData($this->Config->findForId(1),$this->Config);			
		}   	
    }    
}
?>
